﻿@page "/login"

@attribute [AllowAnonymous]
@layout LoginLayout
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject NavigationManager NavigationManager

<PageTitle>Login</PageTitle>
<RadzenText Text="Login" TextStyle="TextStyle.H5" class="mb-4" TagName="TagName.H2" />
<RadzenRow>
    <RadzenColumn SizeMD="12">

        <RadzenTemplateForm TItem="LoginRequestDto" Data=@_loginModel Submit="OnSubmit" InvalidSubmit=@OnInvalidSubmit>

            <RadzenStack Gap="1rem" Class="rz-p-sm-12">
                <RadzenFormField Text="Username" Variant="Variant.Outlined">
                    <ChildContent>
                        <RadzenTextBox Name="Username" @bind-Value=@_loginModel.UserName />
                    </ChildContent>
                    <Helper>
                        <RadzenRequiredValidator Component="Username" Text="Username is required." />
                    </Helper>
                </RadzenFormField>
                <RadzenFormField Text="Password" Variant="@Variant.Outlined">
                    <ChildContent>
                        <RadzenPassword Name="Password" @bind-Value=@_loginModel.Password />
                    </ChildContent>
                    <Helper>
                        <RadzenRequiredValidator Component="Password" Text="Password is required." />
                    </Helper>
                </RadzenFormField>
                <RadzenButton ButtonType="ButtonType.Submit" Text="Submit"></RadzenButton>
            </RadzenStack>

        </RadzenTemplateForm>
    </RadzenColumn>
</RadzenRow>
